Skip to content

Map SEC_E_MUTUAL_AUTH_FAILED SSPI status#128978

Merged
liveans merged 3 commits into
dotnet:mainfrom
liveans:fix_missing_status_code
Jun 8, 2026
Merged

Map SEC_E_MUTUAL_AUTH_FAILED SSPI status#128978
liveans merged 3 commits into
dotnet:mainfrom
liveans:fix_missing_status_code

Conversation

@liveans

@liveans liveans commented Jun 4, 2026

Copy link
Copy Markdown
Member

Note

This content was generated by AI/Copilot.

Add the missing SEC_E_MUTUAL_AUTH_FAILED (0x8009035D) mapping so a failed TLS client-auth handshake surfaces an AuthenticationException instead of crashing on Debug.Fail.

AcceptSecurityContext can return SEC_E_MUTUAL_AUTH_FAILED (0x8009035D) during a failed TLS client-auth handshake. This value was missing from Interop.SECURITY_STATUS and the SecurityStatusAdapterPal dictionary, so GetSecurityStatusPalFromInterop hit Debug.Fail and crashed the process (and threw InternalException in release) instead of surfacing an AuthenticationException.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Windows SSPI/SChannel status translation layer used by System.Net.Security so that SEC_E_MUTUAL_AUTH_FAILED is recognized and mapped into SecurityStatusPalErrorCode, avoiding the “unknown status” fail/throw path during TLS handshakes.

Changes:

  • Add MutualAuthFailed to Interop.SECURITY_STATUS (0x8009035D) for Windows SChannel interop.
  • Add MutualAuthFailed to SecurityStatusPalErrorCode.
  • Add the corresponding entry to the Windows bidirectional status mapping dictionary and bump its expected size.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/libraries/System.Net.Security/src/System/Net/SecurityStatusPal.cs Adds MutualAuthFailed to the shared managed status enum.
src/libraries/System.Net.Security/src/System/Net/SecurityStatusAdapterPal.Windows.cs Extends the Windows SSPI status mapping dictionary and updates the expected size constant.
src/libraries/Common/src/Interop/Windows/SChannel/Interop.SECURITY_STATUS.cs Defines the missing SSPI status constant MutualAuthFailed (0x8009035D).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@rzikm rzikm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copilot AI review requested due to automatic review settings June 5, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

@liveans

liveans commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

/ba-g unrelated failures on CI

@liveans liveans merged commit 987158d into dotnet:main Jun 8, 2026
92 of 95 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants